import gui.MainWindow;

import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.widgets.Display;

import data.access.csv.CsvDataAccess;
import data.model.ProjectsCollection;

/**
 * 
 */

/**

 * 
 */
public class MainClass {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		final Display display = Display.getDefault();
		Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
			@Override
			public void run() {

				String projectWeeksCsvFilePath = "GUI_Pract_ProMo_Product_Data.csv";
				String processCsvFilePath = "GUI_Pract_ProMo_Process_Data.csv";

				ProjectsCollection projectsCollection = new CsvDataAccess(
						projectWeeksCsvFilePath, processCsvFilePath)
						.getAllProjects();

				try {
					MainWindow window = new MainWindow(projectsCollection);
					window.setBlockOnOpen(true);
					window.open();
					Display.getCurrent().dispose();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

}
